<!DOCTYPE html>
<html>
	<link rel="stylesheet" type="text/css" href="./Public/Home/css/clear.css"/>
	<link rel="stylesheet" type="text/css" href="./Public/Home/css/common.css"/>
	<script type="text/javascript" src="./Public/Home/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="./Public/Home/js/land.js"></script>
	<script type="text/javascript">
		$(function(){
			$('.add').click(function(){
				$('.zhezhao').show();
				$('.addDZ').show();
			})
			$('.addX').click(function(){
				$('.zhezhao').hide();
				$('.addDZ').hide();
			})
			
			$('.username').click(function(){
				if($(this).attr('username') == 0){
					$('.outlogin-box').fadeIn();
					$(this).attr('username','1');
				}else{
					$('.outlogin-box').fadeOut();
					$(this).attr('username','0');
				}
			})
			
			$('.ad').click(function(){
				$(this).css({background:"#FDEBEB",border:"1px solid #FBC8C8"}).siblings('.ad').css({background:"white",border:"1px solid #D9D8D6"});
				$(this).attr('address','1').siblings('.ad').attr('address','0');
			})
		})
	</script>
	<head>
		<meta charset="UTF-8">
		<title>结算中心</title>
	</head>
	<body>
		<!--登录-->
<div class="land">	
	<a href="javascript:;" id="landbottom1" class="landTop landTop1">登录</a>
	<a href="javascript:;" id="landbottom2" class="landTop">注册</a>
	<a href="javascript:;" class="x">×</a>
	<div class="landbottom landbottom1">
		<form action="http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=login" method="post">
			<ul>
				<li>
					<span><img src="./Public/Home/images/username.jpg" alt="" /></span>
					<input type="text" name="username" id="" placeholder="请输入手机号" class="user"/>
				</li>
				<li>
					<span><img src="./Public/Home/images/password.jpg" alt="" /></span>
					<input type="password" name="password" id="" placeholder="请输入密码" class="user"/>
				</li>
				<li style="margin-top: 20px;">
					<input type="checkbox" name="" id="" checked="checked"/>
					<sp>自动登录</sp>
				</li>
				<li style="margin-top: 0;">
					<input type="submit" value="登录" class="button"/>
				</li>
			</ul>
		</form>
	</div>
	<div class="landbottom landbottom2">
		<form action="javascript:;" onsubmit="submits(this,'http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=register')" method="post">
			<ul>
				<li>
					<sp>账号：</sp>
					<input type="text" name="username" id="" class="shuru" placeholder="请输入手机号"/>
					<span id="msg"></span>
				</li>
				<li>
					<sp>密码：</sp>
					<input type="password" name="password" id="password" class="shuru" placeholder="请输入密码"/>
				</li>
				<li>
					<sp>确认密码：</sp>
					<input type="password" name="confirmPassword" id="confirmPassword" class="shuru" placeholder="请再次输入密码"/>
					<span class="msg"></span>
				</li>
				<li>
					<sp>验证码：</sp>
					<input type="text" name="" id="code" class="shuru" style="width: 110px;"/>
					<img src="http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=code" onclick="this.src = this.src + '&mt=' + Math.random()" alt=""/>
					<span class="code" style="margin-right: 200px;"></span>
				</li>
				<li>
					<input type="checkbox" name="" id="" checked="checked" style="margin-left: 120px;"/>
					<spa>同意联想的 <a href="" style="color: blue;">使用条款</a> 和 <a href="" style="color: blue;">隐私权政策</a></spa>
				</li>
				<li>
					<input type="submit" value="立即注册" class="button"/>
				</li>
			</ul>
		</form>
	</div>
</div>
<div class="zhezhao"></div>

<script type="text/javascript">
	function submits(obj,url){
		var preg = /(\+86)?1[2-9]\d{9}/;
		if(!obj['username'].value.match(preg)){
			alert('用户名不合法');
			return;
		}
		if(obj['confirmPassword'].value != obj['password'].value){
			alert('2次密码不一致');
			return;
		} 
		var data = $(obj).serialize();
		var username = obj['username'].value;
		var password = obj['password'].value;
		var confirmPassword = obj['confirmPassword'].value;
		var code = obj['code'].value;
		$.ajax({
			type:"post",
			url:url,
			data:{username:username,password:password,confirmPassword:confirmPassword,code:code},
			success:function(data){
				var data = $.parseJSON(data);
				if(data.error == 1){
					alert(data.msg);
				}else{
					obj['username'].value = '';
					obj['password'].value = '';
					obj['confirmPassword'].value = '';
					obj['code'].value = '';
					alert(data.msg);
					$('.land').hide();
					$('.zhezhao').hide();
				}
			}
		});
	}
	$(function(){
		$('input[name=username]').blur(function(){
			var preg = /(\+86)?1[2-9]\d{9}/;
			var pregs = $(this).val().match(preg);
			var username = this;
			var uname = $(this).val();
			$.ajax({
				type:"post",
				url:"http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=username",
				data:{uname:uname,pregs:pregs},
				dataType:"json",
				success:function(data){
					if(data == 1){
						username.error = 1;
						$('#msg').html('<span style="color:red;">用户名已存在</span>');
					}else{
						username.error = 0;
						$('#msg').html('<span style="color:green;">可以注册</span>');
					}
					if(data == 2){
						username.error = 1;
						$('#msg').html('<span style="color:red;">请输入用户名</span>');
					}
					if(data == 3){
						username.error = 1;
						$('#msg').html('<span style="color:red;">用户名不合法</span>');
					}
				}
			})
		})
			
		$('input[name=confirmPassword]').blur(function(){
			var upassword = this;
			var password = $('#password').val();
			var confirmPassword = $('#confirmPassword').val();
			$.ajax({
				type:"post",
				url:"http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=password",
				data:{password:password,confirmPassword:confirmPassword},
				dataType:"json",
				success:function(data){
					if(data == 1){
						confirmPassword.error = 1;
						$('.msg').html('<span style="color:red;">2次密码不一致</span>');
					}else{
						confirmPassword.error = 0;
						$('.msg').html('<span style="color:green;">可以注册</span>');
					}
					if(data == 2){
						confirmPassword.error = 1;
						$('.msg').html('<span style="color:red;">请输入密码</span>');
					}
				}
			})
		})
		
		$('#code').blur(function(){
			var codes = this;
			var code = $(this).val();
			$.ajax({
				type:"post",
				url:"http://127.0.0.1/Xu shixing/Mall/index.php?m=Home&c=Login&a=codes",
				data:{code:code},
				dataType:"json",
				success:function(data){
					if(data == 1){
						codes.error = 1;
						$('.code').html('<span style="color:red;">请输入验证码</span>');
					}else{
						$('.code').html('<span style="color:green;">验证通过</span>');
					}
					if(data == 2){
						$('.code').html('<span style="color:red;">验证码错误</span>');
					}
				}
			})
		})
	})
</script>
		<form action="" method="post">
		<div class="addDZ">
			<ul>
				<li>
					<sp>收货人：</sp>
					<input type="text" name="" id="" style="width: 155px;"/>
				</li>
				<li>
					<sp>手机：</sp>
					<input type="text" name="" id="" style="width: 155px;"/>
					<spa>或固定电话：</spa>
					<input type="text" name="" id="" style="width: 55px;"/>
					<p style="float: left;">—</p>
					<input type="text" name="" id="" style="width: 155px;"/>
				</li>
				<li>
					<sp>地址：</sp>
					
				</li>
				<li>
					<sp>详细地址：</sp>
					<input type="text" name="" id="" style="width: 410px;"/>
				</li>
				<li>
					<sp>邮箱：</sp>
					<input type="text" name="" id="" style="width: 155px;"/>
				</li>
				<li style="width: 150px;height: 18px;margin-left:100px;">
					<input type="checkbox" name="" id="" checked="checked"/>
					<spa style="width: ;">设置为默认收货地址</spa>
				</li>
				<li>
					<input type="submit" value="保存收货人信息" class="button"/>
				</li>
				<a href="javascript:;" class="addX">×</a>
			</ul>
		</div>
		<div class="zhezhao"></div>
		</form>
		<!--头部-->
		<div class="top-box">
			<div class="top">
				<div class="top-left">
				</div>
				<div class="top-right">
					<ul class="right-ul">
						<?php if(isset($_SESSION['username'])){?>
                
						<li><a href="javascript:;" class="order">我的订单</a></li>
						<li>
							<a href="javascript:;" class="username" username="0"><?php echo $_SESSION['username']?></a> | 
							<div class="outlogin-box"><a href="<?php echo U('Login/out')?>">退出登录</a></div>
						</li>
						<?php }else{?>
						<li><a href="javascript:;" class="zhuc">注册</a></li>
						<li><a href="javascript:;" class="dengl">登录</a> | </li>
						
               <?php }?>
						<li><a href="<?php echo U('Index/index')?>">返回首页</a> | </li>
					</ul>
				</div>
			</div>
		</div>
		<!--索引-->
		<div class="logo">
			<div class="logo-left">
				<a href=""><div></div></a>
			</div>
			<div class="logo-right">
				<img src="./Public/Home/images/process2.jpg" alt="" />
			</div>
		</div>
		<!--内容-->
		<form action="" method="post">
		<div class="clear">
			<div class="message">
				<div class="messTop">
					<span>请填写并核对以下信息</span>
				</div>
				<div class="address">
					<span>收货信息：</span>
					<div style="margin-bottom:5px" address="0" class="ad">
						<p>许世星</p>
						<p>13911111111</p>
						<p>北京北京北京北京</p>
						<sp style="margin-left: 305px;">默认地址</sp>
						<a href="" class="sizeRed" style="font-size: 14px;">修改</a>
						<a href="" style="padding-left: 35px;font-size: 20px;color: #7C7C7C;">×</a>
					</div>
					<div style="margin-bottom:5px" address="0" class="ad">
						<p>许世星</p>
						<p>13911111111</p>
						<p>北京北京北京北京</p>
						<sp style="margin-left: 305px;">默认地址</sp>
						<a href="" class="sizeRed" style="font-size: 14px;">修改</a>
						<a href="" style="padding-left: 35px;font-size: 20px;color: #7C7C7C;">×</a>
					</div>
				</div>
				<div class="add">
					<a href="javascript:;">＋使用新地址</a>
				</div>
				<div class="pay">
					<div class="pay-boxA">
						<span>支付方式：</span>
					</div>
					<div class="pay-boxB">
						<a href="javascript:;"><span>在线支付</span><img src="./Public/Home/images/ture.jpg" alt="" /></a>
					</div>
				</div>
				<div class="bill">
					<div class="bill-boxA">
						<span>发票信息 <sp style="font-size: 12px;color: #FF0000;">(发票内容只能开明细)</sp>：</span>
					</div>
					<div class="bill-boxB">
						<sp>发票抬头：<span>个人</span></sp>
						<sp>发票类型：<span>电子发票</span></sp>
						<sp>开票方式：<span>电子发票</span></sp>
						<a href="javascript:;">修改</a>
					</div>
				</div>
			</div>
			<div class="foods">
				<div class="foodsTop">
					<span>确认商品</span>
					<a href="<?php echo U('Shopping/index')?>">返回购物车修改></a>
				</div>
				<div class="type">
					<span class="name">商品名称</span>
					<span class="num">单价</span>
					<span class="num">数量</span>
					<span class="num">金额</span>
				</div>
				<?php foreach ($data as $v){?>
				<div class="det">
					<a href="" class="img"><img src="./Public/Home/images/m.jpg" alt="" /></a>
					<sp><a href="" class="name"><?php echo $v['name']?></a></sp>
					<span><?php echo $v['price']?></span>
					<span><?php echo $v['num']?></span>
					<span style="color: #F3421A;font-weight: bold;"><?php echo $v['total']?></span>
				</div>
				<?php }?>
			</div>
			<!--<div class="coupon">
				<div class="couponTop">
					<span>优惠信息</span>
					<span style="color: #F3421A;margin-left: 10px;">温馨提示：您优惠券、优惠码使用过程中，有任何问题请联系客服</span>
				</div>
				<div class="couCon">
					<a href="" class="img"></a><a href="">使用优惠券</a>
				</div>
				<div class="couCon">
					<a href="" class="img"></a><a href="">使用优惠码</a>
				</div>
				<div class="couCon">
					<a href="" class="img"></a><a href="">使用乐豆</a>
					<span>（总乐豆数量<sp style="color: #E2231A;">0</sp>个）</span>
				</div>
			</div>-->
			<div class="remarks">
				<div class="remarksTop">
					<span>订单备注</span>
				</div>
				<!--<div class="box-a">
					<span>客服经理编码：</span>
					<input type="text" name="" id="" placeholder="如果您联系过客服，可以填写其编码"/>
				</div>-->
				<div class="box-b">
					<!--<span>订单备注:</span>-->
					<textarea name="" id="" cols="30" rows="10" placeholder="特殊要求,限150字" style="resize:none;"></textarea>
				</div>
			</div>
			<div class="item">
				<input type="checkbox" name="" id="" checked="checked"/>
				<a href="javascript:;">我同意 《联想产品网络销售通用条款和条件》</a>
			</div>
			<div class="pri-box">
				<span>商品总数：<sp><?php echo $num?></sp>件</span>
			</div>
			<div class="pri-box">
				<span>商品总价：<sp>￥<?php echo $price?></sp>元</span>
			</div>
			<div class="pri-box">
				<span>运费：<sp>￥0.00</sp>元</span>
			</div>
			<div class="pri-box">
				<span>应付总额：<sp>￥<?php echo $price?></sp>元</span>
			</div>
			<div class="tijiao">
				<a href="pay.html">提交订单</a>
			</div>
		</div>
		</form>
		<!--尾部-->
<div class="wb">
	<div>
		<img src="./Public/Home/images/wb.jpg" alt="" />
	</div>
</div>
<!--尾部-->
<div class="weibu">
	<div>
		<ul>
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
		<ul class="p-left">
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
		<ul class="p-left">
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
		<ul class="p-left">
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
		<ul class="p-left">
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
		<ul class="p-left">
			<li class="no-a">购物指南</li>
			<li><a href="">服务商信息</a></li>
			<li><a href="">购买流程</a></li>
			<li><a href="">注册登录</a></li>
		</ul>
	</div>	
</div>
<div class="dibu">
	<div>
		<a href="">关于联想</a>
		<span> | </span>
		<a href="">联系我们</a>
		<span> | </span>
		<a href="">工作机会</a>
		<span> | </span>
		<a href="">新闻中心</a>
		<span> | </span>
		<a href="">聚享汇会员专享</a>
		<span> | </span>
		<a href="">ZUK官网</a>
		<span> | </span>
		<a href="">联想社区</a>
		<span> | </span>
		<a href="">NBD</a>
		<span> | </span>
		<a href="">懂的通信</a>
		<span> | </span>
		<a href="">联想超融合</a>
		<span> | </span>
		<a href="">销售网点</a>
		<span> | </span>
		<a href="">服务网点</a>
		<p></p>
		<a href="">版权所有：1998-2016 联想集团</a>
		<span> | </span>
		<a href="">法律公告</a>
		<span> | </span>
		<a href="">隐私保护</a>
		<span> | </span>
		<a href="">京ICP备11035381</a>
		<span> | </span>
		<a href="">京公网安备110108007970号</a>
		<span> | </span>
		<a href="">营业执照：110000410127232</a>
	</div>
</div>
	</body>
</html>
